package org.example.Service;

import org.example.mapper.OrderMapper;
import org.example.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService{
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<Order> selectOrders() {
        return orderMapper.selectOrders();
    }

    @Override
    public List<Order> selectOrdersFaHuo() {
        return orderMapper.selectOrdersFaHuo();
    }

    @Override
    public List<Order> selectOrdersIng() {
        return orderMapper.selectOrdersIng();
    }

    @Override
    public List<Order> selectOrdersCancel() {
        return orderMapper.selectOrdersCancel();
    }

    @Override
    public Order selectOrderByOrderIDFaHuo(Integer order_id) {
        return orderMapper.selectOrderByOrderIDFaHuo(order_id);
    }

    @Override
    public Order selectOrderByOrderIDIng(Integer order_id) {
        return orderMapper.selectOrderByOrderIDIng(order_id);
    }

    @Override
    public Order selectOrderByOrderIDCancel(Integer order_id) {
        return orderMapper.selectOrderByOrderIDCancel(order_id);
    }


    @Override
    public List<Order>  selectOrderByUserID(Integer id) {
        return orderMapper.selectOrderByUserID(id);
    }

    @Override
    public List<Order> selectUserOrdersFaHuo(Integer user_id) {
        return orderMapper.selectUserOrdersFaHuo(user_id);
    }

    @Override
    public List<Order> selectUserOrdersIng(Integer user_id) {
        return orderMapper.selectUserOrdersIng(user_id);
    }

    @Override
    public List<Order> selectUserOrdersCancel(Integer user_id) {
        return orderMapper.selectUserOrdersCancel(user_id);
    }


    @Override
    public Order selectUserOrderByOrderIDFaHuo(Integer user_id, Integer order_id) {
        return orderMapper.selectUserOrderByOrderIDFaHuo(user_id,order_id);
    }

    @Override
    public Order selectUserOrderByOrderIDIng(Integer user_id, Integer order_id) {
        return orderMapper.selectUserOrderByOrderIDIng(user_id,order_id);
    }

    @Override
    public Order selectUserOrderByOrderIDCancel(Integer user_id, Integer order_id) {
        return orderMapper.selectUserOrderByOrderIDCancel(user_id,order_id);
    }


    @Override
    public Order selectOrderByID(Integer id) {
        return orderMapper.selectOrderByID(id);
    }


    @Override
    public int insertOrder(Order order) {
        return orderMapper.insertOrder(order);
    }


    @Override
    public int updateOrder(Order order) {
        return orderMapper.updateOrder(order);
    }

    @Override
    public int deleteOrder(Integer id) {
        return orderMapper.deleteOrder(id);
    }
}
